home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / archive / userbox / publicdomain / engclock_v7.0.lha / EngClock_v7.0 / EngClock7_Source / engclock_screen.h < prev    next >
C/C++ Source or Header  |  1995-11-26  |  1KB  |  43 lines

  1. /* English Clock v2.4 Header file for screen mode find out bit */
  2. /* (C) 1995 by Ben Matthew */
  3.  
  4. #include <graphics/view.h>
  5. #include <graphics/gfx.h>
  6. #include <graphics/gfxbase.h>
  7.  
  8. struct {
  9.    int s_width;       /* Width of current screen */
  10.    int s_height;      /* Height of current screen */
  11.    int s_bar;         /* Bar height of windows.  Other font */
  12.    int s_cols;        /* Number of colours available */
  13.    int s_mode;        /* Mode according to s_cols */
  14. }screentype;
  15.  
  16. short getscreentype(void);
  17.  
  18. short getscreentype(void) {
  19.  
  20.    screentype.s_width=pubscreen->Width;
  21.    screentype.s_height=pubscreen->Height;
  22.    screentype.s_bar=pubscreen->BarHeight;
  23.    screentype.s_cols=pubscreen->ViewPort.ColorMap->PalExtra->pe_SharableColors;
  24.  
  25.    /* Following code works out the colour mode: */
  26.  
  27.    switch(screentype.s_cols) {
  28.       case 1:     screentype.s_mode=0;    break;
  29.       case 3:     screentype.s_mode=1;    break;
  30.       case 7:     screentype.s_mode=2;    break;
  31.       case 15:    screentype.s_mode=3;    break;
  32.       case 31:    screentype.s_mode=4;    break;
  33.       case 63:    screentype.s_mode=5;    break;
  34.       case 127:   screentype.s_mode=6;    break;
  35.       case 255:   screentype.s_mode=7;    break;
  36.       default:    screentype.s_mode=0;    break;
  37.    }
  38.    return(0);
  39.  
  40. }
  41.  
  42.  
  43.